3.1.46 \(\int (f+g x) (a+b \log (c (d+e x)^n))^2 \, dx\) [46]

Optimal. Leaf size=186 \[ -\frac {2 a b (e f-d g) n x}{e}+\frac {2 b^2 (e f-d g) n^2 x}{e}+\frac {b^2 g n^2 (d+e x)^2}{4 e^2}-\frac {2 b^2 (e f-d g) n (d+e x) \log \left (c (d+e x)^n\right )}{e^2}-\frac {b g n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2}+\frac {(e f-d g) (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}+\frac {g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2} \]

[Out]

-2*a*b*(-d*g+e*f)*n*x/e+2*b^2*(-d*g+e*f)*n^2*x/e+1/4*b^2*g*n^2*(e*x+d)^2/e^2-2*b^2*(-d*g+e*f)*n*(e*x+d)*ln(c*(
e*x+d)^n)/e^2-1/2*b*g*n*(e*x+d)^2*(a+b*ln(c*(e*x+d)^n))/e^2+(-d*g+e*f)*(e*x+d)*(a+b*ln(c*(e*x+d)^n))^2/e^2+1/2
*g*(e*x+d)^2*(a+b*ln(c*(e*x+d)^n))^2/e^2

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 186, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.318, Rules used = {2448, 2436, 2333, 2332, 2437, 2342, 2341} \begin {gather*} \frac {(d+e x) (e f-d g) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}-\frac {b g n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2}+\frac {g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}-\frac {2 a b n x (e f-d g)}{e}-\frac {2 b^2 n (d+e x) (e f-d g) \log \left (c (d+e x)^n\right )}{e^2}+\frac {b^2 g n^2 (d+e x)^2}{4 e^2}+\frac {2 b^2 n^2 x (e f-d g)}{e} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(f + g*x)*(a + b*Log[c*(d + e*x)^n])^2,x]

[Out]

(-2*a*b*(e*f - d*g)*n*x)/e + (2*b^2*(e*f - d*g)*n^2*x)/e + (b^2*g*n^2*(d + e*x)^2)/(4*e^2) - (2*b^2*(e*f - d*g
)*n*(d + e*x)*Log[c*(d + e*x)^n])/e^2 - (b*g*n*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n]))/(2*e^2) + ((e*f - d*g)*
(d + e*x)*(a + b*Log[c*(d + e*x)^n])^2)/e^2 + (g*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n])^2)/(2*e^2)

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2437

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[(f*(x/d))^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2448

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Int[Exp
andIntegrand[(f + g*x)^q*(a + b*Log[c*(d + e*x)^n])^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[
e*f - d*g, 0] && IGtQ[q, 0]

Rubi steps

\begin {align*} \int (f+g x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx &=\int \left (\frac {(e f-d g) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e}+\frac {g (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e}\right ) \, dx\\ &=\frac {g \int (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx}{e}+\frac {(e f-d g) \int \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx}{e}\\ &=\frac {g \text {Subst}\left (\int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx,x,d+e x\right )}{e^2}+\frac {(e f-d g) \text {Subst}\left (\int \left (a+b \log \left (c x^n\right )\right )^2 \, dx,x,d+e x\right )}{e^2}\\ &=\frac {(e f-d g) (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}+\frac {g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}-\frac {(b g n) \text {Subst}\left (\int x \left (a+b \log \left (c x^n\right )\right ) \, dx,x,d+e x\right )}{e^2}-\frac {(2 b (e f-d g) n) \text {Subst}\left (\int \left (a+b \log \left (c x^n\right )\right ) \, dx,x,d+e x\right )}{e^2}\\ &=-\frac {2 a b (e f-d g) n x}{e}+\frac {b^2 g n^2 (d+e x)^2}{4 e^2}-\frac {b g n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2}+\frac {(e f-d g) (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}+\frac {g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}-\frac {\left (2 b^2 (e f-d g) n\right ) \text {Subst}\left (\int \log \left (c x^n\right ) \, dx,x,d+e x\right )}{e^2}\\ &=-\frac {2 a b (e f-d g) n x}{e}+\frac {2 b^2 (e f-d g) n^2 x}{e}+\frac {b^2 g n^2 (d+e x)^2}{4 e^2}-\frac {2 b^2 (e f-d g) n (d+e x) \log \left (c (d+e x)^n\right )}{e^2}-\frac {b g n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2}+\frac {(e f-d g) (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}+\frac {g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 144, normalized size = 0.77 \begin {gather*} \frac {4 (e f-d g) (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2+2 g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2-8 b (e f-d g) n \left (e (a-b n) x+b (d+e x) \log \left (c (d+e x)^n\right )\right )+b g n \left (b e n x (2 d+e x)-2 (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )\right )}{4 e^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(f + g*x)*(a + b*Log[c*(d + e*x)^n])^2,x]

[Out]

(4*(e*f - d*g)*(d + e*x)*(a + b*Log[c*(d + e*x)^n])^2 + 2*g*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n])^2 - 8*b*(e*
f - d*g)*n*(e*(a - b*n)*x + b*(d + e*x)*Log[c*(d + e*x)^n]) + b*g*n*(b*e*n*x*(2*d + e*x) - 2*(d + e*x)^2*(a +
b*Log[c*(d + e*x)^n])))/(4*e^2)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.61, size = 2616, normalized size = 14.06

method result size
risch \(\text {Expression too large to display}\) \(2616\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*x+f)*(a+b*ln(c*(e*x+d)^n))^2,x,method=_RETURNVERBOSE)

[Out]

I/e*Pi*ln(e*x+d)*b^2*d*f*n*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2+I/e*Pi*ln(e*x+d)*b^2*d*f*n*csgn(I*(e*x+d)^n)*csgn(I
*c*(e*x+d)^n)^2+1/2*I/e*Pi*b^2*d*g*n*x*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2-1/2*I/e^2*Pi*ln(e*x+d)*b^2*d^2*
g*n*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2+1/2*a^2*g*x^2+x*a^2*f+2/e*ln(c)*ln(e*x+d)*b^2*d*f*n+1/e*ln(c)*b^2*d*g*n*x-
1/e^2*ln(e*x+d)*a*b*d^2*g*n+2/e*ln(e*x+d)*a*b*d*f*n-1/2*I*ln(c)*Pi*b^2*g*x^2*csgn(I*c*(e*x+d)^n)^3+1/4*I*Pi*b^
2*g*n*x^2*csgn(I*c*(e*x+d)^n)^3-I*ln(c)*Pi*b^2*f*x*csgn(I*c*(e*x+d)^n)^3-1/2*I*Pi*a*b*g*x^2*csgn(I*c*(e*x+d)^n
)^3-I*Pi*a*b*f*x*csgn(I*c*(e*x+d)^n)^3-1/8*Pi^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^2*g*x^2*csgn(I*c)^2*csgn(I*(e*x+d)^n)^2*csgn(I*c*(
e*x+d)^n)^2-1/2*Pi^2*b^2*g*x^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^4+1/4*Pi^2*b^2*g*x^2*csgn(I*c)*
csgn(I*(e*x+d)^n)^2*csgn(I*c*(e*x+d)^n)^3+1/2*Pi^2*b^2*f*x*csgn(I*c)^2*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^3
-1/4*Pi^2*b^2*f*x*csgn(I*c)^2*csgn(I*(e*x+d)^n)^2*csgn(I*c*(e*x+d)^n)^2-Pi^2*b^2*f*x*csgn(I*c)*csgn(I*(e*x+d)^
n)*csgn(I*c*(e*x+d)^n)^4+1/2*Pi^2*b^2*f*x*csgn(I*c)*csgn(I*(e*x+d)^n)^2*csgn(I*c*(e*x+d)^n)^3+I*Pi*b^2*f*n*x*c
sgn(I*c*(e*x+d)^n)^3-1/e^2*ln(c)*ln(e*x+d)*b^2*d^2*g*n+2*b^2*f*n^2*x-2*a*b*f*n*x

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 324, normalized size = 1.74 \begin {gather*} \frac {1}{2} \, b^{2} g x^{2} \log \left ({\left (x e + d\right )}^{n} c\right )^{2} + 2 \, {\left (d e^{\left (-2\right )} \log \left (x e + d\right ) - x e^{\left (-1\right )}\right )} a b f n e - \frac {1}{2} \, {\left (2 \, d^{2} e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x^{2} e - 2 \, d x\right )} e^{\left (-2\right )}\right )} a b g n e + a b g x^{2} \log \left ({\left (x e + d\right )}^{n} c\right ) + b^{2} f x \log \left ({\left (x e + d\right )}^{n} c\right )^{2} + \frac {1}{2} \, a^{2} g x^{2} + 2 \, a b f x \log \left ({\left (x e + d\right )}^{n} c\right ) - {\left ({\left (d \log \left (x e + d\right )^{2} - 2 \, x e + 2 \, d \log \left (x e + d\right )\right )} n^{2} e^{\left (-1\right )} - 2 \, {\left (d e^{\left (-2\right )} \log \left (x e + d\right ) - x e^{\left (-1\right )}\right )} n e \log \left ({\left (x e + d\right )}^{n} c\right )\right )} b^{2} f + \frac {1}{4} \, {\left ({\left (2 \, d^{2} \log \left (x e + d\right )^{2} + x^{2} e^{2} - 6 \, d x e + 6 \, d^{2} \log \left (x e + d\right )\right )} n^{2} e^{\left (-2\right )} - 2 \, {\left (2 \, d^{2} e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x^{2} e - 2 \, d x\right )} e^{\left (-2\right )}\right )} n e \log \left ({\left (x e + d\right )}^{n} c\right )\right )} b^{2} g + a^{2} f x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="maxima")

[Out]

1/2*b^2*g*x^2*log((x*e + d)^n*c)^2 + 2*(d*e^(-2)*log(x*e + d) - x*e^(-1))*a*b*f*n*e - 1/2*(2*d^2*e^(-3)*log(x*
e + d) + (x^2*e - 2*d*x)*e^(-2))*a*b*g*n*e + a*b*g*x^2*log((x*e + d)^n*c) + b^2*f*x*log((x*e + d)^n*c)^2 + 1/2
*a^2*g*x^2 + 2*a*b*f*x*log((x*e + d)^n*c) - ((d*log(x*e + d)^2 - 2*x*e + 2*d*log(x*e + d))*n^2*e^(-1) - 2*(d*e
^(-2)*log(x*e + d) - x*e^(-1))*n*e*log((x*e + d)^n*c))*b^2*f + 1/4*((2*d^2*log(x*e + d)^2 + x^2*e^2 - 6*d*x*e
+ 6*d^2*log(x*e + d))*n^2*e^(-2) - 2*(2*d^2*e^(-3)*log(x*e + d) + (x^2*e - 2*d*x)*e^(-2))*n*e*log((x*e + d)^n*
c))*b^2*g + a^2*f*x

________________________________________________________________________________________

Fricas [A]
time = 0.48, size = 369, normalized size = 1.98 \begin {gather*} \frac {1}{4} \, {\left (2 \, {\left (b^{2} g x^{2} + 2 \, b^{2} f x\right )} e^{2} \log \left (c\right )^{2} - 2 \, {\left (3 \, b^{2} d g n^{2} - 2 \, a b d g n\right )} x e - 2 \, {\left (b^{2} d^{2} g n^{2} - 2 \, b^{2} d f n^{2} e - {\left (b^{2} g n^{2} x^{2} + 2 \, b^{2} f n^{2} x\right )} e^{2}\right )} \log \left (x e + d\right )^{2} + {\left ({\left (b^{2} g n^{2} - 2 \, a b g n + 2 \, a^{2} g\right )} x^{2} + 4 \, {\left (2 \, b^{2} f n^{2} - 2 \, a b f n + a^{2} f\right )} x\right )} e^{2} + 2 \, {\left (3 \, b^{2} d^{2} g n^{2} - 2 \, a b d^{2} g n - {\left ({\left (b^{2} g n^{2} - 2 \, a b g n\right )} x^{2} + 4 \, {\left (b^{2} f n^{2} - a b f n\right )} x\right )} e^{2} + 2 \, {\left (b^{2} d g n^{2} x - 2 \, b^{2} d f n^{2} + 2 \, a b d f n\right )} e - 2 \, {\left (b^{2} d^{2} g n - 2 \, b^{2} d f n e - {\left (b^{2} g n x^{2} + 2 \, b^{2} f n x\right )} e^{2}\right )} \log \left (c\right )\right )} \log \left (x e + d\right ) + 2 \, {\left (2 \, b^{2} d g n x e - {\left ({\left (b^{2} g n - 2 \, a b g\right )} x^{2} + 4 \, {\left (b^{2} f n - a b f\right )} x\right )} e^{2}\right )} \log \left (c\right )\right )} e^{\left (-2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="fricas")

[Out]

1/4*(2*(b^2*g*x^2 + 2*b^2*f*x)*e^2*log(c)^2 - 2*(3*b^2*d*g*n^2 - 2*a*b*d*g*n)*x*e - 2*(b^2*d^2*g*n^2 - 2*b^2*d
*f*n^2*e - (b^2*g*n^2*x^2 + 2*b^2*f*n^2*x)*e^2)*log(x*e + d)^2 + ((b^2*g*n^2 - 2*a*b*g*n + 2*a^2*g)*x^2 + 4*(2
*b^2*f*n^2 - 2*a*b*f*n + a^2*f)*x)*e^2 + 2*(3*b^2*d^2*g*n^2 - 2*a*b*d^2*g*n - ((b^2*g*n^2 - 2*a*b*g*n)*x^2 + 4
*(b^2*f*n^2 - a*b*f*n)*x)*e^2 + 2*(b^2*d*g*n^2*x - 2*b^2*d*f*n^2 + 2*a*b*d*f*n)*e - 2*(b^2*d^2*g*n - 2*b^2*d*f
*n*e - (b^2*g*n*x^2 + 2*b^2*f*n*x)*e^2)*log(c))*log(x*e + d) + 2*(2*b^2*d*g*n*x*e - ((b^2*g*n - 2*a*b*g)*x^2 +
 4*(b^2*f*n - a*b*f)*x)*e^2)*log(c))*e^(-2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 394 vs. \(2 (177) = 354\).
time = 0.71, size = 394, normalized size = 2.12 \begin {gather*} \begin {cases} a^{2} f x + \frac {a^{2} g x^{2}}{2} - \frac {a b d^{2} g \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{2}} + \frac {2 a b d f \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + \frac {a b d g n x}{e} - 2 a b f n x + 2 a b f x \log {\left (c \left (d + e x\right )^{n} \right )} - \frac {a b g n x^{2}}{2} + a b g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )} + \frac {3 b^{2} d^{2} g n \log {\left (c \left (d + e x\right )^{n} \right )}}{2 e^{2}} - \frac {b^{2} d^{2} g \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{2 e^{2}} - \frac {2 b^{2} d f n \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + \frac {b^{2} d f \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{e} - \frac {3 b^{2} d g n^{2} x}{2 e} + \frac {b^{2} d g n x \log {\left (c \left (d + e x\right )^{n} \right )}}{e} + 2 b^{2} f n^{2} x - 2 b^{2} f n x \log {\left (c \left (d + e x\right )^{n} \right )} + b^{2} f x \log {\left (c \left (d + e x\right )^{n} \right )}^{2} + \frac {b^{2} g n^{2} x^{2}}{4} - \frac {b^{2} g n x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{2} + \frac {b^{2} g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{2} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right )^{2} \left (f x + \frac {g x^{2}}{2}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*ln(c*(e*x+d)**n))**2,x)

[Out]

Piecewise((a**2*f*x + a**2*g*x**2/2 - a*b*d**2*g*log(c*(d + e*x)**n)/e**2 + 2*a*b*d*f*log(c*(d + e*x)**n)/e +
a*b*d*g*n*x/e - 2*a*b*f*n*x + 2*a*b*f*x*log(c*(d + e*x)**n) - a*b*g*n*x**2/2 + a*b*g*x**2*log(c*(d + e*x)**n)
+ 3*b**2*d**2*g*n*log(c*(d + e*x)**n)/(2*e**2) - b**2*d**2*g*log(c*(d + e*x)**n)**2/(2*e**2) - 2*b**2*d*f*n*lo
g(c*(d + e*x)**n)/e + b**2*d*f*log(c*(d + e*x)**n)**2/e - 3*b**2*d*g*n**2*x/(2*e) + b**2*d*g*n*x*log(c*(d + e*
x)**n)/e + 2*b**2*f*n**2*x - 2*b**2*f*n*x*log(c*(d + e*x)**n) + b**2*f*x*log(c*(d + e*x)**n)**2 + b**2*g*n**2*
x**2/4 - b**2*g*n*x**2*log(c*(d + e*x)**n)/2 + b**2*g*x**2*log(c*(d + e*x)**n)**2/2, Ne(e, 0)), ((a + b*log(c*
d**n))**2*(f*x + g*x**2/2), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 595 vs. \(2 (187) = 374\).
time = 4.09, size = 595, normalized size = 3.20 \begin {gather*} \frac {1}{2} \, {\left (x e + d\right )}^{2} b^{2} g n^{2} e^{\left (-2\right )} \log \left (x e + d\right )^{2} - {\left (x e + d\right )} b^{2} d g n^{2} e^{\left (-2\right )} \log \left (x e + d\right )^{2} - \frac {1}{2} \, {\left (x e + d\right )}^{2} b^{2} g n^{2} e^{\left (-2\right )} \log \left (x e + d\right ) + 2 \, {\left (x e + d\right )} b^{2} d g n^{2} e^{\left (-2\right )} \log \left (x e + d\right ) + {\left (x e + d\right )} b^{2} f n^{2} e^{\left (-1\right )} \log \left (x e + d\right )^{2} + {\left (x e + d\right )}^{2} b^{2} g n e^{\left (-2\right )} \log \left (x e + d\right ) \log \left (c\right ) - 2 \, {\left (x e + d\right )} b^{2} d g n e^{\left (-2\right )} \log \left (x e + d\right ) \log \left (c\right ) + \frac {1}{4} \, {\left (x e + d\right )}^{2} b^{2} g n^{2} e^{\left (-2\right )} - 2 \, {\left (x e + d\right )} b^{2} d g n^{2} e^{\left (-2\right )} - 2 \, {\left (x e + d\right )} b^{2} f n^{2} e^{\left (-1\right )} \log \left (x e + d\right ) + {\left (x e + d\right )}^{2} a b g n e^{\left (-2\right )} \log \left (x e + d\right ) - 2 \, {\left (x e + d\right )} a b d g n e^{\left (-2\right )} \log \left (x e + d\right ) - \frac {1}{2} \, {\left (x e + d\right )}^{2} b^{2} g n e^{\left (-2\right )} \log \left (c\right ) + 2 \, {\left (x e + d\right )} b^{2} d g n e^{\left (-2\right )} \log \left (c\right ) + 2 \, {\left (x e + d\right )} b^{2} f n e^{\left (-1\right )} \log \left (x e + d\right ) \log \left (c\right ) + \frac {1}{2} \, {\left (x e + d\right )}^{2} b^{2} g e^{\left (-2\right )} \log \left (c\right )^{2} - {\left (x e + d\right )} b^{2} d g e^{\left (-2\right )} \log \left (c\right )^{2} + 2 \, {\left (x e + d\right )} b^{2} f n^{2} e^{\left (-1\right )} - \frac {1}{2} \, {\left (x e + d\right )}^{2} a b g n e^{\left (-2\right )} + 2 \, {\left (x e + d\right )} a b d g n e^{\left (-2\right )} + 2 \, {\left (x e + d\right )} a b f n e^{\left (-1\right )} \log \left (x e + d\right ) - 2 \, {\left (x e + d\right )} b^{2} f n e^{\left (-1\right )} \log \left (c\right ) + {\left (x e + d\right )}^{2} a b g e^{\left (-2\right )} \log \left (c\right ) - 2 \, {\left (x e + d\right )} a b d g e^{\left (-2\right )} \log \left (c\right ) + {\left (x e + d\right )} b^{2} f e^{\left (-1\right )} \log \left (c\right )^{2} - 2 \, {\left (x e + d\right )} a b f n e^{\left (-1\right )} + \frac {1}{2} \, {\left (x e + d\right )}^{2} a^{2} g e^{\left (-2\right )} - {\left (x e + d\right )} a^{2} d g e^{\left (-2\right )} + 2 \, {\left (x e + d\right )} a b f e^{\left (-1\right )} \log \left (c\right ) + {\left (x e + d\right )} a^{2} f e^{\left (-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="giac")

[Out]

1/2*(x*e + d)^2*b^2*g*n^2*e^(-2)*log(x*e + d)^2 - (x*e + d)*b^2*d*g*n^2*e^(-2)*log(x*e + d)^2 - 1/2*(x*e + d)^
2*b^2*g*n^2*e^(-2)*log(x*e + d) + 2*(x*e + d)*b^2*d*g*n^2*e^(-2)*log(x*e + d) + (x*e + d)*b^2*f*n^2*e^(-1)*log
(x*e + d)^2 + (x*e + d)^2*b^2*g*n*e^(-2)*log(x*e + d)*log(c) - 2*(x*e + d)*b^2*d*g*n*e^(-2)*log(x*e + d)*log(c
) + 1/4*(x*e + d)^2*b^2*g*n^2*e^(-2) - 2*(x*e + d)*b^2*d*g*n^2*e^(-2) - 2*(x*e + d)*b^2*f*n^2*e^(-1)*log(x*e +
 d) + (x*e + d)^2*a*b*g*n*e^(-2)*log(x*e + d) - 2*(x*e + d)*a*b*d*g*n*e^(-2)*log(x*e + d) - 1/2*(x*e + d)^2*b^
2*g*n*e^(-2)*log(c) + 2*(x*e + d)*b^2*d*g*n*e^(-2)*log(c) + 2*(x*e + d)*b^2*f*n*e^(-1)*log(x*e + d)*log(c) + 1
/2*(x*e + d)^2*b^2*g*e^(-2)*log(c)^2 - (x*e + d)*b^2*d*g*e^(-2)*log(c)^2 + 2*(x*e + d)*b^2*f*n^2*e^(-1) - 1/2*
(x*e + d)^2*a*b*g*n*e^(-2) + 2*(x*e + d)*a*b*d*g*n*e^(-2) + 2*(x*e + d)*a*b*f*n*e^(-1)*log(x*e + d) - 2*(x*e +
 d)*b^2*f*n*e^(-1)*log(c) + (x*e + d)^2*a*b*g*e^(-2)*log(c) - 2*(x*e + d)*a*b*d*g*e^(-2)*log(c) + (x*e + d)*b^
2*f*e^(-1)*log(c)^2 - 2*(x*e + d)*a*b*f*n*e^(-1) + 1/2*(x*e + d)^2*a^2*g*e^(-2) - (x*e + d)*a^2*d*g*e^(-2) + 2
*(x*e + d)*a*b*f*e^(-1)*log(c) + (x*e + d)*a^2*f*e^(-1)

________________________________________________________________________________________

Mupad [B]
time = 0.35, size = 268, normalized size = 1.44 \begin {gather*} {\ln \left (c\,{\left (d+e\,x\right )}^n\right )}^2\,\left (\frac {b^2\,g\,x^2}{2}-\frac {d\,\left (b^2\,d\,g-2\,b^2\,e\,f\right )}{2\,e^2}+b^2\,f\,x\right )+x\,\left (\frac {2\,a^2\,d\,g+2\,a^2\,e\,f-2\,b^2\,d\,g\,n^2+4\,b^2\,e\,f\,n^2-4\,a\,b\,e\,f\,n}{2\,e}-\frac {d\,g\,\left (2\,a^2-2\,a\,b\,n+b^2\,n^2\right )}{2\,e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {b\,g\,\left (2\,a-b\,n\right )\,x^2}{2}+\left (\frac {2\,b\,\left (a\,d\,g+a\,e\,f-b\,e\,f\,n\right )}{e}-\frac {b\,d\,g\,\left (2\,a-b\,n\right )}{e}\right )\,x\right )+\frac {g\,x^2\,\left (2\,a^2-2\,a\,b\,n+b^2\,n^2\right )}{4}+\frac {\ln \left (d+e\,x\right )\,\left (3\,g\,b^2\,d^2\,n^2-4\,e\,f\,b^2\,d\,n^2-2\,a\,g\,b\,d^2\,n+4\,a\,e\,f\,b\,d\,n\right )}{2\,e^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f + g*x)*(a + b*log(c*(d + e*x)^n))^2,x)

[Out]

log(c*(d + e*x)^n)^2*((b^2*g*x^2)/2 - (d*(b^2*d*g - 2*b^2*e*f))/(2*e^2) + b^2*f*x) + x*((2*a^2*d*g + 2*a^2*e*f
 - 2*b^2*d*g*n^2 + 4*b^2*e*f*n^2 - 4*a*b*e*f*n)/(2*e) - (d*g*(2*a^2 + b^2*n^2 - 2*a*b*n))/(2*e)) + log(c*(d +
e*x)^n)*(x*((2*b*(a*d*g + a*e*f - b*e*f*n))/e - (b*d*g*(2*a - b*n))/e) + (b*g*x^2*(2*a - b*n))/2) + (g*x^2*(2*
a^2 + b^2*n^2 - 2*a*b*n))/4 + (log(d + e*x)*(3*b^2*d^2*g*n^2 - 4*b^2*d*e*f*n^2 - 2*a*b*d^2*g*n + 4*a*b*d*e*f*n
))/(2*e^2)

________________________________________________________________________________________